import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
import MachineManage from '../views/MachineManage'
import LogMangge from '../views/LogManage'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/home',
    name: 'home',
    component: Home,
    children: [{
      path: '/machine',
      name: 'machine',
      component: MachineManage,
    },
    {
      path: '/log',
      name: 'log',
      component : LogMangge,
    }
  ]
  }

]
const router = new VueRouter({
  mode: "history",
  routes
})

export default router